package ar.com.aterrizar.ui;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.layout.VerticalLayout;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.Window;
import org.uqbar.arena.windows.WindowOwner;

import ar.com.aterrizar.uimodels.SimpleMessageModel;

public class SimpleMessageWindow extends Window<SimpleMessageModel>{
	String  labelText, buttonText;
	
	public SimpleMessageWindow(WindowOwner owner,String  labelText, String buttonText) {
		super(owner, new SimpleMessageModel());
		this.labelText=labelText;
		this.buttonText=buttonText;
	}

	@Override
	public void createContents(Panel mainPanel) {
		this.setTitle("Aterrizar.com.ar");

		mainPanel.setLayout(new VerticalLayout());

		new Label(mainPanel).setText(this.labelText);	

		new Button(new Panel(mainPanel))
			.setCaption("Cerrar")
			.onClick(new MessageSend(this, "close"));
	}

}
